//
//  ZHNewFeatureController.m
//  ZHLifeCircle
//
//  Created by user on 15/11/21.
//  Copyright © 2015年 heima. All rights reserved.
//

#import "ZHNewFeatureController.h"

@interface ZHNewFeatureController ()

@end

@implementation ZHNewFeatureController

- (void)viewDidLoad {
    [super viewDidLoad];
    NSLog(@"222");
    UIScrollView *scrollView = [[UIScrollView alloc] initWithFrame:kScreenBounds];
    scrollView.pagingEnabled = YES;
    scrollView.contentSize = CGSizeMake(kScreenWidth * 3, 0);
    [self.view addSubview:scrollView];
    scrollView.bounces = NO;
    scrollView.showsHorizontalScrollIndicator = NO;
    for(int i = 0; i < 3; i++){
        NSString *imageName = [NSString stringWithFormat:@"guide_%d",i];
        if (i == 2) {
            //添加按钮
            UIButton *btn = [[UIButton alloc] initWithFrame:CGRectMake(i * kScreenWidth, 0, kScreenWidth, kScreenHeight)];
            [btn setBackgroundImage:[UIImage imageNamed:imageName] forState:UIControlStateNormal];
            [btn addTarget:self action:@selector(enterHomeController) forControlEvents:UIControlEventTouchUpInside];
            [scrollView addSubview:btn];
        }
        else{
            UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(i * kScreenWidth, 0, kScreenWidth, kScreenHeight)];
            imageView.image = [UIImage imageNamed:imageName];
            [scrollView addSubview:imageView];
        }
    }
}

- (void)enterHomeController{
    //发送通知
    [[NSNotificationCenter defaultCenter] postNotificationName:@"enterHomeViewController" object:nil];
}




- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
